package com.chaowei.lims.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DBHelper extends SQLiteOpenHelper {
	private static final int DB_VERSION = 1;
	private static final String DB_NAME = "lims.db";
	private static final String TABLE_HOME = "homefuncs";
	private static final String TABLE_PROCESS = "processfuncs";
	private static final String TABLE_SAMPLE = "samplefuncs";
	private static final String TABLE_STANDARD = "standardfuncs";
	private static final String TABLE_FINANCE = "financefuncs";

	private static final String CREATE_TABLE_HOME = "create table if not exists homefuncs(name varchar(20),drawid Integer,state Integer)";
	private static final String CREATE_TABLE_PROCESS = "create table if not exists processfuncs(name varchar(20),drawid Integer,state Integer)";
	private static final String CREATE_TABLE_SAMPLE = "create table if not exists samplefuncs(name varchar(20),drawid Integer,state Integer)";
	private static final String CREATE_TABLE_STANDARD  = "create table if not exists standardfuncs(name varchar(20),drawid Integer,state Integer)";
	private static final String CREATE_TABLE_FINANCE = "create table if not exists financefuncs(name varchar(20),drawid Integer,state Integer)";
	
	
	
	public DBHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(CREATE_TABLE_HOME);
		db.execSQL(CREATE_TABLE_PROCESS);
		db.execSQL(CREATE_TABLE_SAMPLE);
		db.execSQL(CREATE_TABLE_STANDARD);
		db.execSQL(CREATE_TABLE_FINANCE);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

	}

}
